repo.or.cz
/
and.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Adding some more judges, here and there.
[and.git]
/
UVa
/
10298 - Power Strings
/
gen.rb
blob
d35d6ebe3e9b628bb3df166600a132515dfb57c9
1
def f(i)
2
if i == 0
3
return [""]
4
else
5
ans = []
6
old = f(i - 1)
7
'a'[0].upto 'c'[0] do |c|
8
old.each do |s|
9
ans << c.chr + s
10
end
11
end
12
return ans
13
end
14
end
15
16
2.upto(10) do |i|
17
a = f(i)
18
puts a.join("\n")
19
end
20
puts "."